<!DOCTYPE html>
<html>
  <head>
    {{template "title" .}}
    {{ template "scripts_global" . }}
</head>
<body>
	{{ template "scripts" . }}
    {{ template "sidebar" . }}
	{{ template "content" . }}
<footer>
</footer>
</body>
</html>

{{ define "scripts_global" }}
<link rel="shortcut icon" href="/assets/img/favicon.ico" type="image/x-icon" />
<link href="/assets/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="/assets/js/lib/require-setup.js"></script>
<script type="text/javascript" src="/assets/js/lib/require.js"></script>{{ end }}
{{ define "scripts" }}{{ end }}
{{ define "sidebar" }}
<!-- 导航条 -->
    <nav class="navbar navbar-default">
      <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <!-- <a class="navbar-brand" href="/">Home</a> -->
          <a class="navbar-brand" href="/">
            <img alt="Brand" width="20" height="20" src="/assets/img/icon_brand.png">
          </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <li class="active">
              <a href="/">Home <span class="sr-only">(current)</span></a>
            </li>
            <li><a href="/about">About</a></li>
            <li><a href="https://github.com/hb-chen">GitHub</a></li>
          </ul>
          
          <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Account <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                {{if .UserId}}
                  <li><a href="/logout?return_url={{.requestUrl}}">Logout</a></li>
                {{else}}
                  <li><a href="/login?return_url={{.requestUrl}}">Login</a></li>
                  <li><a href="/register?return_url={{.requestUrl}}">Register</a></li>
                {{end}}
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-fluid -->
    </nav>
{{ end }}